# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=YAML-Syck
pkgname=perl-YAML-Syck
pkgver=1.32
pkgrel=1
pkgdesc="Fast, lightweight YAML loader and dumper"
arch=('i686' 'x86_64')
url="https://metacpan.org/release/YAML-Syck"
license=('BSD' 'custom')
depends=('perl')
groups=('perl-modules')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/T/TO/TODDR/YAML-Syck-${pkgver}.tar.gz
        'msysize.patch')
sha256sums=('db1d90ec03e0466e134e6032d03eaf73a7305631bcdbbfd8fe5356bd77cae9bb'
            'db21cdfc97ccbc346af5cc266ad6f5b971efa3cfb420099d2760b7471a89057a')

prepare() {
  cd YAML-Syck-${pkgver}
  patch -p1 -i ${srcdir}/msysize.patch
}

build() {
  cd YAML-Syck-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd YAML-Syck-${pkgver}
  make test
}

package() {
  cd YAML-Syck-${pkgver}
  make install DESTDIR="${pkgdir}"
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # fix permissons
  find ${pkgdir}/usr -type f \( -name *.dll -o -name *.exe \) | xargs chmod 0755
}
